<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns="http://www.w3.org/1999/xhtml" 
                template="./../Template/AdminTemplate.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        <f:view>
            <h:form>

                <h:panelGrid columns="2">
                    <f:facet name="header">  
                        Update Event 
                    </f:facet>
                    <h:outputLabel value="EventId:"  />
                    <h:outputText  value="#{eventControl.selectedevent.eventId}" />

                    <h:outputLabel value="Title:" for="title" />
                    <p:inputTextarea rows="6" cols="33" value="#{eventControl.selectedevent.title}"/>

                    <h:outputLabel value="Photo:" for="photo" />

                    <p:fileUpload mode="advanced" update="preview"  sizeLimit="1000000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" auto="true"  fileUploadListener="#{eventControl.handleFileUploadEditEvent}" />  
                    <h:outputLabel value="Avatar:" for="preview" />
                    <h:commandLink id="preview" value="" ><img src="#{eventControl.newEvent.photo}" height="100" width="70" /></h:commandLink>


                    <h:outputLabel value="StartRegDate:" for="startRegDate" />
                    <p:calendar value="#{eventControl.selectedevent.startRegDate}" id="startRegDate" showButtonPanel="true"/>

                    <h:outputLabel value="EndRegDate:" for="endRegDate" />
                    <p:calendar value="#{eventControl.selectedevent.endRegDate}" id="endRegDate" showButtonPanel="true"/>
                    <h:outputLabel value="StartDate" for="startDate"/>
                    <p:calendar value="#{eventControl.selectedevent.startDate}" id="startDate" showButtonPanel="true"/>
                    <h:outputLabel value="EndDate:" for="endDate" />
                    <p:calendar value="#{eventControl.selectedevent.endDate}" id="endDate" showButtonPanel="true"/>
                    <h:outputLabel value="MinPlayer:" for="minPlayer" />
                    <h:inputText id="minPlayer" value="#{eventControl.selectedevent.minPlayer}" title="MinPlayer" />
                    <h:outputLabel value="MaxPlayer:" for="maxPlayer" />
                    <h:inputText id="maxPlayer" value="#{eventControl.selectedevent.maxPlayer}" title="MaxPlayer" />
                    <h:outputLabel value="IsActive"/>
                    <p:selectBooleanCheckbox value="#{eventControl.selectedevent.isActive}" />
                    <h:outputLabel value="Description:" for="description" />
                    <p:editor value="#{eventControl.selectedevent.description}"/>
                    <p:commandButton value="Create" action="#{eventControl.edit()}"/>

                </h:panelGrid>
            </h:form>
        </f:view>
    </ui:define>

</ui:composition>
